home *** CD-ROM | disk | FTP | other *** search
- global gEnvironmentSound, gOBJECTSE, gObjects, gStates, NULLrect, gHotRects, gCursorlist, gWorld, sQTSPRITE, sQTCharSprite, gSoundchannels
-
- on doGoToG22
- set initList to [#lookAtPelletDispenser]
- set killList to [#goToG22, #goToF01, #goToH01]
- changeHotSpots(initList, killList, #false)
- setaProp(getaProp(gObjects, #CarDash), #State, #off)
- setaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel, 0)
- changeGasGauge(1, #false)
- genexitkf(#G22)
- end
-
- on doGoToF01
- set initList to [#lookAtPelletDispenser]
- set killList to [#goToG22, #goToF01, #goToH01]
- changeHotSpots(initList, killList, #false)
- setaProp(getaProp(gObjects, #CarDash), #State, #off)
- setaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel, 0)
- changeGasGauge(1, #false)
- genexitkf(#F01)
- end
-
- on doGoToH01
- set initList to [#lookAtPelletDispenser]
- set killList to [#goToG22, #goToF01, #goToH01]
- changeHotSpots(initList, killList, #false)
- setaProp(getaProp(gObjects, #CarDash), #State, #off)
- setaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel, 0)
- changeGasGauge(1, #false)
- genexitkf(#H01)
- end
-
- on doLookAtPelletDispenser
- Jumptokey(#E05)
- CursorandUpdate()
- end
-
- on doLookLeft
- set initList to []
- set killList to [#carEmerHotRect]
- changeHotSpots(initList, killList, #true)
- Jumptokey(#E03)
- CursorandUpdate()
- end
-
- on doLookRight
- set droveOrTowed to getaProp(getaProp(gObjects, #GasManQT), #droveOrTowed)
- set runoutCount to getaProp(getaProp(gObjects, #CarGasGauge), #runoutCount)
- if (runoutCount <> 4) or (droveOrTowed <> #towed) or (getaProp(gStates, #Credits) <= 0) then
- Jumptokey(#E04)
- else
- Jumptokey(#E04b)
- end if
- CursorandUpdate()
- end
-
- on DoCarRadOn
- set OBj to getaProp(gObjects, #CarRadOn)
- set PAR to getaProp(gObjects, getaProp(OBj, #Parent))
- set curState to getaProp(PAR, #State)
- if curState = #on then
- MakeDynamic(getaProp(OBj, #Parent), #State, #off)
- MakeDynamic(#CarRadOn, #DisplayState, #close)
- set whichStation to "E01rad" & getaProp(PAR, #station) & ".aif"
- stopsound(whichStation)
- else
- if curState = #off then
- MakeDynamic(getaProp(OBj, #Parent), #State, #on)
- MakeDynamic(#CarRadOn, #DisplayState, #open)
- set whichStation to "E01rad" & getaProp(PAR, #station) & ".aif"
- playSound(whichStation, #AmbientLoop, 0)
- end if
- end if
- end
-
- on DocarIgni
- set OBj to getaProp(gObjects, #carIgni)
- set PAR to getaProp(gObjects, getaProp(OBj, #Parent))
- set fuelLevel to getaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel)
- if fuelLevel > 0 then
- set gas to #HaveGAS
- else
- set gas to #NOGAS
- end if
- playSound(getaProp(getProp(OBj, #sound), gas), #cast, 1)
- updateStage()
- if gas = #HaveGAS then
- playSound("E01idle.aif", #cast, 0)
- if getaProp(getaProp(gObjects, #carMap), #curZone) < 375 then
- MakeDynamic(getaProp(OBj, #Parent), #State, #on)
- end if
- end if
- end
-
- on DocarEmer
- set carEmerObj to getaProp(gObjects, #carEmer)
- if getaProp(getaProp(getaProp(gObjects, #carEmer), #animator), #pbPauseState) = 1 then
- setaProp(getaProp(carEmerObj, #animator), #pbPauseState, 0)
- set timerRef to Startthetimer(300, "doKnock")
- setaProp(carEmerObj, #timerRef, timerRef)
- else
- if not voidp(getaProp(carEmerObj, #animator)) then
- setaProp(getaProp(carEmerObj, #animator), #pbPauseState, 1)
- set whichCast to getAt(getaProp(getaProp(carEmerObj, #cast), #FrameData), 2)
- set SpriteNum to getaProp(carEmerObj, #SpriteNum)
- set the castNum of sprite SpriteNum to whichCast
- DeletetheTimer(getaProp(carEmerObj, #timerRef))
- end if
- end if
- end
-
- on doKnock
- playSound("E02knock.aif", #cast, 0)
- set initList to [#carLookLeft]
- set killList to []
- changeHotSpots(initList, killList, #true)
- end
-
- on DoopenCarMap
- set OBj to getaProp(gObjects, #transCarDashView)
- set curScale to getaProp(getaProp(gObjects, #carMap), #curScale)
- setaProp(getaProp(OBj, #cast), #UP, the number of cast string("EG" & curScale & ".pct"))
- MakeDynamic(#transCarDashView, #cast, getaProp(getaProp(gObjects, #transCarDashView), #cast))
- setaProp(getaProp(gObjects, #GasManQT), #clickCount, 1)
- set initList to []
- set killList to [#carLookRight]
- changeHotSpots(initList, killList, #false)
- set mapGaugeObj to getaProp(gObjects, #MapCarGasGauge)
- set carGaugeObj to getaProp(gObjects, #CarGasGauge)
- set fuelLevel to getaProp(getaProp(gObjects, #CarGasGauge), #fuelLevel)
- setaProp(mapGaugeObj, #DisplayState, getAt(getaProp(carGaugeObj, #allStates), fuelLevel + 1))
- setaProp(mapGaugeObj, #fuelLevel, fuelLevel)
- Jumptokey(#E02)
- CursorandUpdate()
- end
-
- on DoCarRadTuneLft
- set OBj to getaProp(gObjects, #CarRadio)
- set nStations to count(getaProp(OBj, #stationLocs))
- set whichStation to getaProp(OBj, #station)
- if whichStation > 1 then
- set stationName to "E01rad" & whichStation & ".aif"
- stopsound(string(stationName))
- set whichStation to whichStation - 1
- set newStation to getAt(getaProp(OBj, #stationLocs), whichStation)
- MakeDynamic(#CarRadio, #loc, newStation)
- MakeDynamic(#CarRadio, #station, whichStation)
- set the loc of sprite 10 to newStation
- set stationName to "E01rad" & whichStation & ".aif"
- playSound(stationName, #AmbientLoop, 0)
- end if
- end
-
- on DoCarRadTuneRt
- set OBj to getaProp(gObjects, #CarRadio)
- set nStations to count(getaProp(OBj, #stationLocs))
- set whichStation to getaProp(OBj, #station)
- if whichStation < 5 then
- set stationName to "E01rad" & whichStation & ".aif"
- stopsound(string(stationName))
- set whichStation to whichStation + 1
- set newStation to getAt(getaProp(OBj, #stationLocs), whichStation)
- MakeDynamic(#CarRadio, #loc, newStation)
- MakeDynamic(#CarRadio, #station, whichStation)
- set the loc of sprite 10 to newStation
- set stationName to "E01rad" & whichStation & ".aif"
- playSound(stationName, #AmbientLoop, 0)
- end if
- end
-
- on changeGasGauge newStateNum, onFrame
- set OBj to getaProp(gObjects, #CarGasGauge)
- set newState to getAt(getaProp(OBj, #allStates), newStateNum)
- MakeDynamic(#CarGasGauge, #DisplayState, newState)
- if onFrame = #true then
- set GaugeSpriteNum to getaProp(OBj, #SpriteNum)
- set the castNum of sprite GaugeSpriteNum to getaProp(getaProp(OBj, #cast), newState)
- end if
- CursorandUpdate()
- end
-
- on updateGasGauge
- set OBj to getaProp(gObjects, #CarGasGauge)
- set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), getaProp(OBj, #DisplayState))
- CursorandUpdate()
- end
-
- on decrementGasGauge
- set carGaugeObj to getaProp(gObjects, #CarGasGauge)
- set mapGaugeObj to getaProp(gObjects, #MapCarGasGauge)
- set newFuelLevel to getaProp(carGaugeObj, #fuelLevel) - 1
- if newFuelLevel = -1 then
- exit
- end if
- setaProp(carGaugeObj, #fuelLevel, newFuelLevel)
- setaProp(carGaugeObj, #DisplayState, getAt(getaProp(carGaugeObj, #allStates), newFuelLevel + 1))
- setaProp(mapGaugeObj, #DisplayState, getAt(getaProp(carGaugeObj, #allStates), newFuelLevel + 1))
- set the castNum of sprite getaProp(mapGaugeObj, #SpriteNum) to getaProp(getaProp(carGaugeObj, #cast), getaProp(carGaugeObj, #DisplayState))
- CursorandUpdate()
- end
-